package com.ossjk.oa.attendance.service.impl;

import com.ossjk.core.vo.PagePreNextVo;
import com.ossjk.oa.attendance.entity.Atdreport;
import com.ossjk.oa.attendance.entity.Vemp2Dept;
import com.ossjk.oa.attendance.mapper.AtdreportMapper;
import com.ossjk.oa.attendance.service.IAtdreportService;
import com.baomidou.mybatisplus.mapper.SqlHelper;
import com.baomidou.mybatisplus.mapper.Wrapper;
import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 考勤申报 服务实现类
 * </p>
 *
 * @author chair
 * @since 2019-02-03
 */
@Service
public class AtdreportServiceImpl extends ServiceImpl<AtdreportMapper, Atdreport> implements IAtdreportService {
	@Override
	public Page selectVoPage(Page page, Wrapper wrapper) {
		SqlHelper.fillWrapper(page, wrapper);
		page.setRecords(baseMapper.selectVoPage(page, wrapper));
		return page;
	}
	public PagePreNextVo selectPreNext(String midMth) {

		PagePreNextVo vo = new PagePreNextVo();
		String tmp =this.baseMapper.selectPreMth(midMth);
		vo.setPre(tmp==null?" ":tmp);
		tmp =this.baseMapper.selectNextMth(midMth);
		vo.setNext(tmp==null?" ":tmp );
		vo.setCurrent(midMth);

		return vo;
	}
	@Override
	public Vemp2Dept selectDaoHao(Wrapper wapper) {
		return baseMapper.selectDaoHao(wapper);
	}

	@Override
	public List selectDetail(Wrapper wapper) {
		return baseMapper.selectDetail(wapper);
	}

	@Override
	public List selectVo(Wrapper wrapper) {
		return baseMapper.selectVo(wrapper);
	}


}
